package xyz.yuanjilu.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import xyz.yuanjilu.dao.SalesDao;
import xyz.yuanjilu.entity.SalesEntity;
import xyz.yuanjilu.service.SalesService;
import xyz.yuanjilu.utils.ShiroUtils;



@Service("salesService")
public class SalesServiceImpl implements SalesService {
	@Autowired
	private SalesDao salesDao;
	
	@Override
	public SalesEntity queryObject(Long id){
		return salesDao.queryObject(id);
	}
	
	@Override
	public List<SalesEntity> queryList(Map<String, Object> map){
		return salesDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return salesDao.queryTotal(map);
	}
	
	@Override
	public void save(SalesEntity sales){
		sales.setCreateUserId(ShiroUtils.getUserId()+"");
		salesDao.save(sales);
	}
	
	@Override
	public void update(SalesEntity sales){
		salesDao.update(sales);
	}
	
	@Override
	public void delete(Long id){
		salesDao.delete(id);
	}
	
	@Override
	public void deleteBatch(Long[] ids){
		salesDao.deleteBatch(ids);
	}
	
}
